<?php

class MyClass
{
    public function test(OtherClass $otherClass)
    {
        echo $otherClass->var;
    }

    public function test_array(array $input_array)
    {
        print_r($input_array);
    }

    public function test_interface(Traversable $iterator)
    {
        echo get_class($iterator);
    }

    public function test_callable(callable $callback, $data)
    {
        call_user_func($callback, $data);
    }
}

class OtherClass
{
    public $var = "hello world";
}

$myClass = new MyClass();

$otherClass = new OtherClass();

$myClass->test('hello');